<include file="Public:head" />
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>管理员添加</h5>
        </div>
        <div class="ibox-content">
            <form action="{:url('Admin/add')}" method="post" enctype="multipart/form-data" id="brandForm" class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-2 control-label">管理员账号</label>

                    <div class="col-sm-6">
                        <input type="text" class="form-control" value="" name="account" id="account" placeholder="管理员账号...">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">管理员角色</label>

                    <div class="col-sm-6">
                        <select class="form-control m-b" name="role_id" id="">
                            <volist name="role" id="vo">
                                <option value="{$vo['role_id']}">{$vo['role_name']}</option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">管理员密码</label>

                    <div class="col-sm-6">
                        <input type="password" class="form-control" name="passwd" id="passwd" placeholder="管理员密码..." value="" />
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">确认密码</label>

                    <div class="col-sm-6">
                        <input type="password" class="form-control" name="repasswd" id="repasswd" placeholder="确认密码..." value="" />
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">真实姓名</label>

                    <div class="col-sm-6">
                        <input type="text" class="form-control" value="" name="real_name" id="real_name" placeholder="真实姓名...">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">联系电话</label>

                    <div class="col-sm-6">
                        <input type="text" class="form-control" value=""  name="phone" id="phone" placeholder="联系电话...">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">联系地址</label>

                    <div class="col-sm-6">
                        <input type="text" class="form-control" value="" name="address" id="address" placeholder="联系地址..." />
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button class="btn btn-primary" type="submit">提交</button>
                        <!--<button class="btn btn-white" type="submit">取消</button>-->
                        <!--<input type="button" class="btn btn-primary" value="提交"/>-->
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- End Panel Basic -->
</div>
<script src="__STATIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script type="text/javascript">
$(document).ready(function(){
 //tab
 $(".admin_tab li a").click(function(){
  var liindex = $(".admin_tab li a").index(this);
  $(this).addClass("active").parent().siblings().find("a").removeClass("active");
  $(".admin_tab_cont").eq(liindex).fadeIn(150).siblings(".admin_tab_cont").hide();
 });

    $(".btn-primary").click(function(){

        if($("#account").val()==""){
            parent.layer.alert("管理员账号不能为空!",{
                shade: false //不显示遮罩
            });
            return false;
        }

        if($("#passwd").val()==""){
            parent.layer.alert("管理员密码不能为空!",{
                shade: false //不显示遮罩
            });
            return false;
        }

        if($("#passwd").val()!=$("#repasswd").val()){
            parent.layer.alert("两次密码不一样!",{
                shade: false //不显示遮罩
            });
            return false;
        }
        if($("#real_name").val()==""){
            parent.layer.alert("真实姓名不能为空!",{
                shade: false //不显示遮罩
            });
            return false;
        }
        if($("#phone").val()==""){
            parent.layer.alert("联系电话不能为空!",{
                shade: false //不显示遮罩
            });
            return false;
        }
        if($("#address").val()==""){
            parent.layer.alert("联系地址不能为空!",{
                shade: false //不显示遮罩
            });
            return false;
        }
        $("#brandForm").submit();
    });

 });
</script>

<script type="text/javascript">

//实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
var ue = UE.getEditor('editor');


function isFocus(e){
alert(UE.getEditor('editor').isFocus());
UE.dom.domUtils.preventDefault(e)
}
function setblur(e){
UE.getEditor('editor').blur();
UE.dom.domUtils.preventDefault(e)
}
function insertHtml() {
var value = prompt('插入html代码', '');
UE.getEditor('editor').execCommand('insertHtml', value)
}
function createEditor() {
enableBtn();
UE.getEditor('editor');
}


</script>
	 


 </div>
</section>
</body>
</html>
